<!--
  Generated template for the DiscoveryPage page.

  See http://ionicframework.com/docs/components/#navigation for more info on
  Ionic pages and navigation.
-->
<ion-header>
  <ion-navbar color="gm-primary">
    <ion-title>每日分享</ion-title>

    <ion-buttons right *ngIf="user_info.type > 8">
      <button ion-button icon-only (click)="onPubDiscovery()">
        <ion-icon name="create"></ion-icon>
      </button>
    </ion-buttons>
  </ion-navbar>
</ion-header>

<ion-content>
  <ion-refresher (ionRefresh)="onRefresh($event)">
    <ion-refresher-content
        pullingIcon="arrow-dropdown"
        pullingText="下拉开始刷新"
        refreshingSpinner="circles"
        refreshingText="数据正在载入">
    </ion-refresher-content>
  </ion-refresher>

  <div *ngIf="share_list.length > 0">
    <ion-card class="share-item" *ngFor="let share of share_list">
      <div class="share-header">
        <img src="assets/icon/admin.png">
        <div>{{share.content}}</div>
      </div>
      <img [src]="share.image | resource:'images'" (click)="onImageTap()">
      <ion-card-content>
        <p>{{share.content}}</p>
        <ion-note margin-bottom float-right>{{share.updated_at|date:'MM月dd日 HH点mm分'}}</ion-note>
      </ion-card-content>
    </ion-card>
  </div>

  <div *ngIf="share_list.length == 0" class="no-data">
    <img src="assets/icon/empty.png">
    <div>还没有分享内容呦</div>
  </div>
</ion-content>
